<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>修改符号链接的所有组</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.is-writeable.html">« is_writeable</a></li>
      <li style="float: right;"><a href="function.lchown.html">lchown »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.filesystem.html">文件系统函数</a></li>
    <li>修改符号链接的所有组</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.lchgrp" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">lchgrp</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.3, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">lchgrp</span> &mdash; <span class="dc-title">修改符号链接的所有组</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.lchgrp-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>lchgrp</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>, <span class="methodparam"><span class="type"><span class="type">string</span>|<span class="type">int</span></span> <code class="parameter">$group</code></span>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   尝试修改符号链接 <code class="parameter">filename</code> 的所有组 <code class="parameter">group</code>
  </p>
  <p class="para">
   只有超级用户可以任意修改符号链接的所有组;其他用户可能需要有修改目标组的权限才能修改至目标所有组。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.lchgrp-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">filename</code></dt>

     <dd>

      <p class="para">
       符号链接路径
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">group</code></dt>

     <dd>

      <p class="para">
       所有组的名字或者编号
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.lchgrp-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>true</code></strong>， 或者在失败时返回 <strong><code>false</code></strong>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.lchgrp-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2198">
    <p><strong>示例 #1 更改符号链接的所有组</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$target&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'output.php'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$link&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'output.html'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">symlink</span><span style="color: #007700">(</span><span style="color: #0000BB">$target</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">lchgrp</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.lchgrp-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: <span class="simpara">此函数不能作用于<a href="features.remote-files.html" class="link">远程文件</a>，被检查的文件必须是可通过服务器的文件系统访问的。</span></p></blockquote>
  <blockquote class="note"><p><strong class="note">注意</strong>: <span class="simpara">此函数未在 Windows 平台下实现。</span></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.lchgrp-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.chgrp.html" class="function" rel="rdfs-seeAlso">chgrp()</a> - 改变文件所属的组</span></li>
    <li class="member"><span class="function"><a href="function.lchown.html" class="function" rel="rdfs-seeAlso">lchown()</a> - 修改符号链接的所有者</span></li>
    <li class="member"><span class="function"><a href="function.chown.html" class="function" rel="rdfs-seeAlso">chown()</a> - 改变文件的所有者</span></li>
    <li class="member"><span class="function"><a href="function.chmod.html" class="function" rel="rdfs-seeAlso">chmod()</a> - 改变文件模式</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>